package Core::Field;

use strict;
use warnings;
use vars qw{ @ISA @EXPORT };
use Exporter;
use Core::Meta;

@ISA = qw( Core::Meta );
@EXPORT = qw (  
	Field
);

sub Field
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
    my $rhMeta = Core::Field->new( @_ );
    return $rhMeta;
}

sub new
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my( $rhClass ) = shift;               # Object    
    my( $rhSelf ) = {};
    bless( $rhSelf, $rhClass);
    
	my( $sName ) = shift; 
    return 0 if not $sName;
	
	$rhSelf->setName( $sName );
	$rhSelf->init();
	return $rhSelf;
}

sub init
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my( $rhSelf ) = shift; 
	$rhSelf->selected();
    $rhSelf->{ INNULLVALUE } = "";
	$rhSelf->{ OUTNULLVALUE } = "NA";
	$rhSelf->{ TRIMTYPE } = 0;
}

sub setTrimType
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my ( $rhSelf ) = shift; 
	my ( $sTrimType ) = shift;
	return 0 if not defined $sTrimType;
	
	$rhSelf->{ TRIMTYPE } = $sTrimType;
}

sub getTrimType
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my( $rhSelf ) = shift; 
	return $rhSelf->{ TRIMTYPE };
}


sub setInNullValue
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my( $rhSelf ) = shift; 
	my( $sInNullValue ) = shift;
	
	return 0 if not defined $sInNullValue;
	$rhSelf->{ INNULLVALUE } = $sInNullValue;
}

sub getInNullValue
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my( $rhSelf ) = shift; 
	return $rhSelf->{ INNULLVALUE };
}

sub setOutNullValue
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my( $rhSelf ) = shift; 
	my( $sOutNullValue ) = shift;
	
	return 0 if not defined $sOutNullValue;
	$rhSelf->{ OUTNULLVALUE } = $sOutNullValue;
}

sub getOutNullValue
#*****************************************************************************
# PURPOSE:
# USAGE: 
# PASSED ARGS:
# RETURN ARGS:
# $sError - Fail Error Message
#*****************************************************************************
{
	my( $rhSelf ) = shift; 
	return $rhSelf->{ OUTNULLVALUE };
} 


1
__END__;